<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/templates/template.xhtml">

	<ui:define name="body">

		<h:body>

			<h:outputScript name="locale-primefaces.js" library="js" />

			<style type="text/css">
.aplicar {
	background-image: url("../sinca/resources/imagens/apply.png") !important;
}
</style>

			<h:form id="formProcesso" styleClass="semBorda">

				<div id="divMess" align="center" style="width: 70%; height: 10%">
					<!--
				<p:messages id="messages" showDetail="false" autoUpdate="true" closable="true" />
				-->
					<p:growl id="growl" showDetail="true" sticky="true" />
				</div>

				<p:panel id="pnSalvar" header="Cadastrar novo Processo"
					style="margin-bottom:20px" toggleable="true">
					<h:panelGrid columns="5" cellpadding="10" style=" width : 770px;">
						<h:panelGrid columns="1" cellpadding="10" style=" width : 150px;">
							<p:commandButton id="btnConsultarProcesso"
								value="Salvar Processo" ajax="false"
								action="#{manterProcessoMB.salvarProcessoCA()}"
								icon="ui-icon-document" />
						</h:panelGrid>
					</h:panelGrid>
				</p:panel>

				<p:tabView dynamic="true" cache="false" effect="fade"
					id="tab_pricipal" styleClass="semBorda" orientation="top">

					<p:tab title="Processo" id="tb_processo">
						<p:panel id="pnDetalhament" header="Dados do Processo"
							style="margin-bottom:20px" toggleable="true">

							<h:panelGrid columns="5" cellpadding="10" style=" width : 770px;">
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 150px;">
									<h:outputLabel value="Nº Protocolo CA:" />
									<p:inputText id="inpt_numProtocoloCa"
										value="Gerado Pelo Sistema" disabled="true" size="20"
										maxlength="20" />
								</h:panelGrid>
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 150px;">
									<h:outputLabel value="Data Protocolo CA:" />
									<p:calendar id="dataProtocoCA"
										value="#{manterProcessoMB.processo.dataProtocoloCa}"
										showOn="button" locale="pt" size="10" />
								</h:panelGrid>
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 150px;">
									<h:outputLabel value="Nº Protocolo MJ-SEI:" />
									<p:inputText id="inpt_numProtocoloMJ_SEI" size="25"
										value="#{manterProcessoMB.processo.numProtocoloMj}"
										maxlength="25" />
								</h:panelGrid>
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 150px;">
									<h:outputLabel value="Data Protocolo MJ-SEI" />

									<p:inputText id="input_dataProtocoMJ_SEI" disabled="true"
										value="#{manterProcessoMB.processo.dataProtocoloMJ}" size="10"
										maxlength="10" />

								</h:panelGrid>

								<h:panelGrid columns="1" cellpadding="10">
									<h:outputLabel value="Consultar/Obter no SEI" />
									<p:commandButton id="btnConsultarSei" ajax="false"
										icon="aplicar"
										actionListener="#{manterProcessoMB.consultarProcesso()}">
										<f:ajax execute="inpt_numProtocoloMJ_SEI"
											render="input_dataProtocoMJ_SEI" />
									</p:commandButton>
								</h:panelGrid>

							</h:panelGrid>

							<h:panelGrid columns="1" cellpadding="10" style=" width : 670px;">
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Localização:*" />
									<p:selectOneMenu value="#{manterProcessoMB.idLocalizacao}"
										effect="fade">
										<f:selectItem itemLabel="Selecione uma Localizacao"
											noSelectionOption="true" />
										<f:selectItems value="#{manterProcessoMB.listarLocalizacao}"
											var="item" itemLabel="#{item.descLocalizacao}"
											itemValue="#{item.idLocalizacao}" />
									</p:selectOneMenu>
								</h:panelGrid>
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Status do Processo:*" />
									<p:selectOneMenu value="#{manterProcessoMB.idStatusProcesso}"
										style=" width: 737px;" effect="fade">
										<f:selectItem itemLabel="Selecione um Status do Processo"
											noSelectionOption="true" />
										<f:selectItems
											value="#{manterProcessoMB.listarStatusProcesso}" var="item"
											itemLabel="#{item.descStatusProcesso}"
											itemValue="#{item.idStatusProcesso}" />
									</p:selectOneMenu>
								</h:panelGrid>
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Substatus do Processo:*" />
									<p:selectOneMenu
										value="#{manterProcessoMB.idSubStatusProcesso}"
										style=" width : 737px;" effect="fade">
										<f:selectItem itemLabel="Selecione Sub Status do Processo"
											noSelectionOption="true" />
										<f:selectItems
											value="#{manterProcessoMB.listarSubStatusProcesso}"
											var="item" itemLabel="#{item.descSubStatusProcesso}"
											itemValue="#{item.idSubStatusProcesso}" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" cellpadding="30"
									style=" width : 200px;">
									<h:outputLabel value="Complemento do Status:" />
									<p:inputTextarea id="txtAreaComplementoStatus" maxlength="400"
										rows="4" cols="100"
										value="#{manterProcessoMB.processo.descComplementoStatus}" />
								</h:panelGrid>

								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Grupo Processual:*" />
									<p:selectOneMenu value="#{manterProcessoMB.idGrupoProcessual}"
										style=" width : 737px;" effect="fade">
										<f:selectItem itemLabel="Selecione Grupo Processual"
											noSelectionOption="true" />
										<f:selectItems
											value="#{manterProcessoMB.listarGrupoProcessual}" var="item"
											itemLabel="#{item.descGrupoProcessual}"
											itemValue="#{item.idGrupoProcessual}" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Subgrupo Processual:*" />
									<p:selectOneMenu
										value="#{manterProcessoMB.idSubGrupoProcessual}"
										style=" width : 737px;" effect="fade">
										<f:selectItem itemLabel="Selecione Sub Grupo Processual"
											noSelectionOption="true" />
										<f:selectItems
											value="#{manterProcessoMB.listarSubGrupoProcessual}"
											var="item" itemLabel="#{item.descSubGrupoProcessual}"
											itemValue="#{item.idSubGrupoProcessual}" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Cargo / Função:" />
									<p:selectOneMenu value="#{manterProcessoMB.idCargoFuncao}"
										style=" width : 737px;" effect="fade">
										<f:selectItem itemLabel="Selecione Cargo / Função"
											noSelectionOption="true" />
										<f:selectItems value="#{manterProcessoMB.listarCargoFuncao}"
											var="item" itemLabel="#{item.descCargoFuncao}"
											itemValue="#{item.idCargoFuncao}" />
									</p:selectOneMenu>
								</h:panelGrid>
							</h:panelGrid>

							<h:panelGrid columns="1" cellpadding="10" style=" width : 120px;">
								<h:outputLabel value="Grupo Social" />
								<p:selectOneMenu value="#{manterProcessoMB.idGrupoSocial}"
									style=" width : 737px;" effect="fade">
									<f:selectItem itemLabel="Selecione Grupo Social"
										noSelectionOption="true" />
									<f:selectItems value="#{manterProcessoMB.listarGrupoSocial}"
										var="item" itemLabel="#{item.descGrupoSocial}"
										itemValue="#{item.idGrupoSocial}" />
								</p:selectOneMenu>
							</h:panelGrid>

							<h:panelGrid columns="1" cellpadding="10" style=" width : 120px;">
								<h:outputLabel value="Subgrupo Social" />
								<p:selectOneMenu value="#{manterProcessoMB.idSubGrupoSocial}"
									style=" width : 737px;" effect="fade">
									<f:selectItem itemLabel="Selecione Sub Grupo Social"
										noSelectionOption="true" />
									<f:selectItems value="#{manterProcessoMB.listarSubGrupoSocial}"
										var="item" itemLabel="#{item.descSubGrupoSocial}"
										itemValue="#{item.idSubGrupoSocial}" />
								</p:selectOneMenu>
							</h:panelGrid>

						</p:panel>

						<p:panel id="pnlDadosAdicionais" header="Dados Adicionais"
							style="margin-bottom:20px;width : 100%" toggleable="true">

							<h:panelGrid columns="4" style=" width : 90%;">

								<h:panelGrid columns="1" style=" width : 200px;">
									<p:outputLabel value="Tipo*:" />
									<p:selectOneMenu value="#{manterProcessoMB.idTipo}"
										effect="fade">
										<f:selectItem itemValue="1" itemLabel="Documento" />
										<f:selectItem itemValue="2" itemLabel="Processo" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" style=" width : 200px;">
									<p:outputLabel value="Protocolo Externo:*:" />
									<p:selectOneMenu value="#{manterProcessoMB.idProtocoloExterno}"
										effect="fade">
										<f:selectItem itemValue="1" itemLabel="Sim" />
										<f:selectItem itemValue="2" itemLabel="Não" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" style=" width : 200px;">
									<p:outputLabel value="Data Protocolo:*:" />
									<p:calendar id="dataProtocoMJ_SEI_Dadoas"
										value="#{manterProcessoMB.dadosAdicionais.dataProtocoloMj}"
										showOn="button" locale="pt" size="10" />
								</h:panelGrid>

								<h:panelGrid columns="1" style=" width : 200px;">
									<p:outputLabel value="Data Emissão:*:" />
									<p:calendar id="dataEmissão"
										value="#{manterProcessoMB.dadosAdicionais.dataEmissao}"
										showOn="button" locale="pt" size="10" />
								</h:panelGrid>

							</h:panelGrid>

							<h:panelGrid columns="2" style=" width : 907px;">

								<h:panelGrid columns="1" style=" width : 107px;">
									<p:outputLabel value="Assunto :" />
									<p:selectOneMenu value="#{manterProcessoMB.idAssunto}"
										effect="fade" style=" width : 400px;">
										<f:selectItem itemLabel="Selecione o Assunto"
											noSelectionOption="true" />
										<f:selectItems value="#{manterProcessoMB.listarAssunto}"
											var="item" itemLabel="#{item.descAssunto}"
											itemValue="#{item.idAssunto}" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<p:outputLabel value="Espécie :" />
									<p:selectOneMenu value="#{manterProcessoMB.idEspecie}"
										effect="fade" style=" width : 200px;">
										<f:selectItem itemLabel="Selecione a Especie"
											noSelectionOption="true" />
										<f:selectItems value="#{manterProcessoMB.listarEspecie}"
											var="item" itemLabel="#{item.descEspecie}"
											itemValue="#{item.idEspecie}" />
									</p:selectOneMenu>
								</h:panelGrid>
							</h:panelGrid>

							<h:panelGrid columns="2" style=" width : 907px;">
								<h:panelGrid columns="1" cellpadding="30" style=" width :200px;">
									<h:outputLabel value="Resumo :" />
									<p:inputTextarea id="txtAreaResumo" maxlength="200" rows="4"
										cols="54"
										value="#{manterProcessoMB.dadosAdicionais.descResumo}" />
								</h:panelGrid>

								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Natureza:*" />
									<p:selectOneMenu value="#{manterProcessoMB.idNatureza}"
										style=" width : 200px;" effect="fade">
										<f:selectItem itemLabel="Selecione a Natureza"
											noSelectionOption="true" />
										<f:selectItems value="#{manterProcessoMB.listarNatureza}"
											var="item" itemLabel="#{item.descNatureza}"
											itemValue="#{item.idNatureza}" />
									</p:selectOneMenu>
								</h:panelGrid>
							</h:panelGrid>

							<h:panelGrid columns="1" style=" width : 907px;">
								<h:panelGrid columns="1" cellpadding="10"
									style=" width : 120px;">
									<h:outputLabel value="Procedência:" />
									<p:selectOneMenu value="#{manterProcessoMB.idProcedencia}"
										style=" width : 730px;" effect="fade">
										<f:selectItem itemLabel="Selecione a Procedência"
											noSelectionOption="true" />
										<f:selectItems value="#{manterProcessoMB.listarProcedencia}"
											var="item" itemLabel="#{item.descProcedencia}"
											itemValue="#{item.idProcedencia}" />
									</p:selectOneMenu>
								</h:panelGrid>
							</h:panelGrid>


							<h:panelGrid columns="4" style=" width : 90%;">

								<h:panelGrid columns="1" style=" width : 200px;">
									<p:outputLabel value="Acompanhamento Externo:*:" />
									<p:selectOneMenu
										value="#{manterProcessoMB.idAcompanhamentoExterno}"
										effect="fade">
										<f:selectItem itemValue="1" itemLabel="Sim" />
										<f:selectItem itemValue="2" itemLabel="Não" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" style=" width : 200px;">
									<p:outputLabel value="Tipo Protocolo:*:" />
									<p:selectOneMenu value="#{manterProcessoMB.idTipoProtocolo}"
										effect="fade">
										<f:selectItem itemLabel="Selecione o Tipo Protocolo"
											noSelectionOption="true" />
										<f:selectItems value="#{manterProcessoMB.listarTipoProcesso}"
											var="item" itemLabel="#{item.descTipoProcesso}"
											itemValue="#{item.idTipoProcesso}" />
									</p:selectOneMenu>
								</h:panelGrid>

								<h:panelGrid columns="1" style=" width : 200px;">
									<p:outputLabel value="Data Autuação:*:" />
									<p:calendar id="dataAtuaçãoMJ_SEI_Dadoas"
										value="#{manterProcessoMB.dadosAdicionais.dataAtuacao}"
										showOn="button" locale="pt" size="10" />
								</h:panelGrid>
							</h:panelGrid>
						</p:panel>



					</p:tab>


					<p:tab title="Interessados" id="Interessados_1">
						<!-- CADASTRO DE INTERESSADOS -->

						<!-- CADASTRO DE INTERESSADOS -->
						<p:tabView dynamic="false" cache="false" effect="fade"
							id="tbAnistiados" styleClass="semBorda" orientation="top">
							<p:tab title="Anistiado" id="tab_anistiados" disabled="false">

								<p:commandButton id="btnInserirAnist"
									value="Inserir no Processo" ajax="true" actionListener="#{manterAnistiadoMB.addSessaoAnistiado}"
									update=":formProcesso:tab_pricipal:tbAnistiados"
									icon="ui-icon-newwin" title="Inserir" />
								<ui:insert name="interessados">
									<ui:include src="/formularioProcessoAnistiados.xhtml" />
								</ui:insert>

							</p:tab>

							<!-- FIM ANISTIDADOs -->


							<p:tab title="Requrente" id="tab_requerentes" disabled="false">

								<p:commandButton id="btnInserirRequerente"
									value="Inserir no Processo" ajax="true" action="#"
									icon="ui-icon-newwin" title="Inserir" />
								<ui:insert name="interessados">
									<ui:include src="/formularioProcessoRequerente.xhtml" />
								</ui:insert>

							</p:tab>

							<p:tab title="Procurador" id="tab_procurador" disabled="false">

								<p:commandButton id="btnInserirProcurador"
									value="Inserir no Processo" ajax="true" action="#"
									icon="ui-icon-newwin" title="Inserir" />
								<ui:insert name="interessados">
									<ui:include src="/formularioProcessoProcurador.xhtml" />
								</ui:insert>

							</p:tab>


							<p:tab title="3º Diligenciado" id="tab_diligenciado" disabled="false">

								<p:commandButton id="btnInserirDiligenciado"
									value="Inserir no Processo" ajax="true" action="#"
									icon="ui-icon-newwin" title="Inserir" />
								<ui:insert name="interessados">
									<ui:include src="/formularioProcessoTerceiroDiligenciado.xhtml" />
								</ui:insert>

							</p:tab>


						</p:tabView>


					</p:tab>



				</p:tabView>
			</h:form>

		</h:body>
	</ui:define>
</ui:composition>